package com.aidysoft.practice.propertiesToSetValue;

import com.aidysoft.practice.mybaties.mapper.User4Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 〈〉
 */
@RestController
@RequestMapping("/api")
public class UsersController {
    private static final Logger log = LoggerFactory.getLogger(UsersController.class);

    private final Users users;
    private final Users2 users2;

    @Autowired
    public  UsersController(Users users, Users2 users2){
        this.users = users;
        this.users2 = users2;
    }

    @GetMapping("/getUsersValueOfPropertites")
    public ResponseEntity getUsers(){
        return ResponseEntity.ok(users);
    }
    @GetMapping("/getUsers2ValueOfPropertites")
    public ResponseEntity getUsers2(){
        log.info("users2",users2.toString());
        System.out.println(users2.toString());
        return ResponseEntity.ok(users2);
    }

}
